package com.moli.iov.base.enums;

/**
 * <p>
 * 报警类型 枚举
 * </p>
 *
 * @author whl
 * @since 2019-09-20
 */
public enum FenceAlarmTypeEnum {

  INTO(0, "进围栏报警"),
  OUT(1, "出围栏报警");

  private int code;

  private String cnName;

  private FenceAlarmTypeEnum(int code, String cnName) {
    this.code = code;
    this.cnName = cnName;
  }

  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }

  public String getCnName() {
    return cnName;
  }

  public void setCnName(String cnName) {
    this.cnName = cnName;
  }

  public static String getCodeName(int code) {
    for (FenceAlarmTypeEnum e : FenceAlarmTypeEnum.values()) {
      if (e.code == code) {
        return e.cnName;
      }
    }
    return null;
  }

}
